﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
    xmlns:notification="clr-namespace:Mantin.Controls.Wpf.Notification;assembly=Mantin.Controls.Wpf.Notification"
    xmlns:demoApplication="clr-namespace:DemoApplication"
    xmlns:enumComboBox="clr-namespace:Mantin.Controls.Wpf.EnumComboBox;assembly=Mantin.Controls.Wpf.EnumComboBox"
    x:Class="DemoApplication.MainWindow"
    Title="Toast Popup/Help Balloon Sample Application" Height="600" Width="525" WindowStartupLocation="CenterScreen"
    Background="LightGray" ResizeMode="NoResize" Icon="Resources/toast.ico">
    <Window.DataContext>
        <demoApplication:ViewModel/>
    </Window.DataContext>
    <TabControl>
        <TabItem Header="Toast Popup/Help Balloon">
                <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="20"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Grid.Resources>
            <Style TargetType="Label" x:Key="Header">
                <Setter Property="HorizontalAlignment" Value="Center"/>
                <Setter Property="FontSize" Value="18"/>
                <Setter Property="FontWeight" Value="Bold"/>
            </Style>
            <Style TargetType="Label" x:Key="SubHeader">
                 <Setter Property="FontSize" Value="14"/>
                <Setter Property="FontWeight" Value="Bold"/>
            </Style>
            <Style TargetType="Button">
                <Setter Property="Margin" Value="0,10,0,0"/>
                <Setter Property="HorizontalAlignment" Value="Stretch"/>
            </Style>
        </Grid.Resources>
        
        <Rectangle Grid.Column="1" Fill="DarkGray" Grid.RowSpan="3"
                   Width="5" Margin="0,10,0,10"/>

        <Label Style="{StaticResource Header}" Grid.Column="0" Grid.Row="0">Toast Popup</Label>

        <StackPanel Orientation="Vertical" Grid.Column="0" Grid.Row="1" Margin="10">
            <TextBlock Text="Title"/>
            <TextBox Text="{Binding Title}"/>

            <TextBlock Text="Text"/>
            <TextBox TextWrapping="WrapWithOverflow" 
                     Height="80"
                     AcceptsReturn="True"
                     ScrollViewer.VerticalScrollBarVisibility="Auto"
                     Text="{Binding Text}"/>

            <TextBlock Text="Hyper link Text"/>
            <TextBox Text="{Binding HyperlinkText}"/>

            <TextBlock Text="Type"/>
            <ComboBox ItemsSource="{Binding NotificationTypeList}"
                      SelectedItem="{Binding SelectedNotificationType}"
                      DisplayMemberPath="Description"
                      SelectedIndex="0"
                      SelectedValuePath="Value"/>
            
            <TextBlock Text="Max Toast"/>
            <xctk:IntegerUpDown Value="{Binding MaxToast}" Minimum="0" Maximum="255"/>
                
            <TextBlock Text="Font Color"/>
            <xctk:ColorPicker SelectedColor="{Binding FontColor}" />

            <TextBlock Text="Border Color"/>
            <xctk:ColorPicker SelectedColor="{Binding BorderColor}" />

            <TextBlock Text="Background Linear Start"/>
            <xctk:ColorPicker SelectedColor="{Binding StartColor}" />

            <TextBlock Text="Background Linear End"/>
            <xctk:ColorPicker SelectedColor="{Binding EndColor}"/>

            <Button Content="Pop Toast" 
                    Command="{Binding PopToastCommand}"
                    CommandParameter="1"/>

            <Button Content="Pop Toast with Resource Image" 
                    Command="{Binding PopToastCommand}"
                    CommandParameter="2"/>

            <Button Content="Pop Toast with Formatted InLines" 
                    Command="{Binding PopToastCommand}"
                    CommandParameter="3"/>
        </StackPanel>

        <Label Style="{StaticResource Header}" Grid.Column="2" Grid.Row="0">Help Balloon</Label>
        <StackPanel Grid.Column="2" 
                    Grid.Row="1"
                    Orientation="Vertical" 
                    Margin="10">
            <TextBlock Text="Type"/>
            <ComboBox ItemsSource="{Binding BalloonTypeList}"
                      SelectedItem="{Binding SelectedBalloonType}"
                      DisplayMemberPath="Description"
                      SelectedIndex="0"
                      SelectedValuePath="Value"/>

            <CheckBox Content="Show Close Button" VerticalAlignment="Center" IsChecked="{Binding ShowBalloonCloseButton}"/>

            <Label Style="{StaticResource SubHeader}">Bound to Help Balloon Control</Label>

            <TextBlock Text="Caption Title"/>
            <TextBox Text="{Binding BalloonTitle}"/>

            <TextBlock Text="Caption Text"/>
            <TextBox TextWrapping="WrapWithOverflow" 
                     AcceptsReturn="True" 
                     Height="80" 
                     ScrollViewer.VerticalScrollBarVisibility="Auto"
                     Text="{Binding HelpText, UpdateSourceTrigger=PropertyChanged}"/>

            <TextBlock Text="Max Height"/>
             <TextBox Width="105" 
                      HorizontalAlignment="Left"
                      Text="{Binding MaxHeight}"/>

            <TextBlock Text="Max Width"/>
            <TextBox Width="105" 
                     HorizontalAlignment="Left" 
                     Text="{Binding MaxWidth}"/>

            <CheckBox Content="Auto Width" VerticalAlignment="Center" IsChecked="{Binding AutoWidth}"/>

            <notification:HelpBalloon Margin="0,20,0,0" 
                                      Caption="{Binding HelpText}" 
                                      BalloonType="{Binding BalloonType}" 
                                      AutoWidth="{Binding AutoWidth}"
                                      MaxHeight="{Binding MaxHeight}"
                                      MaxWidth="{Binding MaxWidth}"
                                      Title="{Binding BalloonTitle}"
                                      ShowCloseButton="{Binding ShowBalloonCloseButton}" />

            <Label Style="{StaticResource SubHeader}">General Use</Label>
            <TextBox x:Name="textBoxGeneralUse" 
                     TextWrapping="WrapWithOverflow" 
                     Height="40" 
                     Text="Move your mouse over this textbox."
                     MouseEnter="TextBoxGeneralUseMouseEnter"/>
        </StackPanel>
        <CheckBox Content="CheckBox" HorizontalAlignment="Left" Margin="-133,276,0,0" Grid.Row="1" VerticalAlignment="Top"/>

    </Grid>
        </TabItem>
        <TabItem Header="EnumComboBox">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Label Grid.Row="0">Enum bound to a ComboBox</Label>
                <enumComboBox:EnumComboBox EnumType="{x:Type demoApplication:Status}" SelectedValue="{Binding Status}" Grid.Row="1" Margin="4"/>
                <Border Grid.Row="2" Margin="5" BorderThickness="1" BorderBrush="Gray">
                    <TextBlock TextWrapping="WrapWithOverflow" Text="{Binding EnumFile}" />
                </Border>
            </Grid>
        </TabItem>
    </TabControl>

</Window>
